import java.util.*;

/**
 * @Author 12629
 * @Description：
 */
public class Test {

    public static void main(String[] args) {
        Game game = new Game();
        List<Card> cardList = game.createCards();
        System.out.println("初始牌："+cardList);

        game.shuffle(cardList);

        System.out.println("洗过的牌："+cardList);


        List<List<Card>> hand = game.play(cardList);
        for (int i = 0; i < hand.size(); i++) {
            System.out.println("第"+(i+1)+"个人的牌是："+hand.get(i));
        }

        System.out.println("剩下的牌："+cardList);

    }


    public List<List<Integer>> generate(int numRows) {
        List<List<Integer>> ret = new ArrayList<>();
        //ret.add(new ArrayList<>());
        List<Integer> list0 = new ArrayList<>();
        list0.add(1);
        ret.add(list0);
        //从第2行开始
        for (int i = 1; i < numRows; i++) {
            List<Integer> tmpList = new ArrayList<>();
            //这是当前行的第一个
            tmpList.add(1);
            //上一行的list
            List<Integer> prevRow = ret.get(i-1);
            //这是当前行的中间的值
            for (int j = 1; j < i; j++) {
                int val1 = prevRow.get(j);
                int val2 = prevRow.get(j-1);
                tmpList.add(val1+val2);
            }
            //这是当前行的最后一个
            tmpList.add(1);
            ret.add(tmpList);
        }
        return ret;
    }

    public static void main1(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);

        ArrayList<Integer> tmpList = new ArrayList<>(list);
        tmpList.add(99);
        System.out.println(tmpList);
    }
}
